<template>
	<view class="j_cont">
		<!-- 头部 -->
		<view class="j_top">
			彩中心
		</view>
		<!-- 登录 -->
		<view class="j_login">
			<!-- left -->
			<view class="j_lginimg">
				<img :src="list.avatar" alt="">
			</view>
			<!-- name -->
			<view class="j_loginname">
				<view class="j_name_top">
					<text @click="personal(list.id)">{{list.nickname}}</text>
				</view>
				<view @click="identity(list.id)" style="color: #FAAB34;" v-if="whethers">
					点击验证
				</view>
				<view class="j_name_bom" @click="citizen(list.id)" v-if="whether">
					<img src="http://127.0.0.1:7001/public/user/shenfen.png" alt="" />
				</view>
			</view>
			<!-- right -->
			<view class="j_login_right">
				<!-- 我的积分 -->
				<view class="j_integral">
					<text>积分钱包</text>
				</view>
				<view class="j_number">
					<text>{{lists[0].kjf}}</text>
				</view>
			</view>
		</view>
		<!-- 收获地址 -->
		<view class="j_address" @click="region(list.id)">
			<!-- icon图标 -->
			<view class="j_icon">
				<img src="http://127.0.0.1:7001/public/user/dizhi.png" alt="">
			</view>
			<!-- title -->
			<view class="j_title"><text>收货地址</text></view>
			<!-- right -->
			<view class="j_addright">
				<view class="j_addcont"> > </view>
			</view>
		</view>
		<view class="j_solid"></view>
		<!-- 我的订单 -->
		<view class="j_address" @click="myOrder">
			<!-- icon图标 -->
			<view class="j_icon">
				<img src="http://127.0.0.1:7001/public/user/dingdan.png" alt="">
			</view>
			<!-- title -->
			<view class="j_title"><text>我的订单</text></view>
			<!-- right -->
			<view class="j_addright">
				<view class="j_addcont"> > </view>
			</view>
		</view>
		<view class="j_solid"></view>
		<!-- 我发布的商品 -->
		<view class="j_address" @click="commodity">
			<!-- icon图标 -->
			<view class="j_icon">
				<img src="http://127.0.0.1:7001/public/user/shangpin.png" alt="">
			</view>
			<!-- title -->
			<view class="j_title"><text>我发布的商品</text></view>
			<!-- right -->
			<view class="j_addright">
				<view class="j_addcont"> > </view>
			</view>
		</view>
		<view class="j_solid"></view>
		<!-- 我的发布的活动 -->
		<view class="j_address" @click="Discount">
			<!-- icon图标 -->
			<view class="j_icon">
				<img src="http://127.0.0.1:7001/public/user/huodong.png" alt="">
			</view>
			<!-- title -->
			<view class="j_title"><text>我发布的活动</text></view>
			<!-- right -->
			<view class="j_addright">
				<view class="j_addcont"> > </view>
			</view>
		</view>
		<!-- 关于彩蛋校园 -->
		<view class="j_address j_details" @click="details">
			<!-- icon图标 -->
			<view class="j_icon">
				<img src="http://127.0.0.1:7001/public/user/xiaoyuan.png" alt="">
			</view>
			<!-- title -->
			<view class="j_title"><text>关于彩蛋校园</text></view>
			<!-- right -->
			<view class="j_addright">
				<view class="j_addcont"> > </view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				whether: false,
				whethers: true,
				lists: []
			};
		},
		methods: {
			//我发布的活动
			Discount() {
				uni.navigateTo({
					url: `/pages/person/Discount/Discount`
				})
			},
			//我发布是商品
			commodity() {
				uni.navigateTo({
					url: `/pages/person/commodity/commodity`
				})
			},
			//评价
			myOrder() {
				uni.navigateTo({
					url: `/pages/person/myOrder/myOrder`
				})
			},
			//设置收货地址页面
			region(id) {
				uni.navigateTo({
					url: `/pages/person/region/region?id=${id}`
				})
			},
			//身份认证之后
			citizen(id) {
				uni.navigateTo({
					url: `/pages/person/citizen/citizen?id=${id}`
				})
			},
			//身份认证
			identity(id) {
				uni.navigateTo({
					url: `/pages/person/identity/identity`
				})
			},
			//关于彩蛋校园
			details() {
				uni.navigateTo({
					url: "/pages/person/details/details"
				})
			},
			personal(id) {
				uni.navigateTo({
					url: `/pages/person/personal/personal?id=${id}`
				})
			}
		},
		onShow() {
			//获取登录用户信息
			this.$api.LogingetMsg().then(res => {
				this.list = res.data
			})
			this.$api.jagetMsg().then(res => {
				this.lists = res.data
			})
			//看当前用户是否认证
			this.$api.jsearchMsgs({
				id: this.list.id
			}).then(res => {
				if (res.code == 200) {
					this.whether = true,
						this.whethers = false
				}
			})
		},
		updated() {
			//看当前用户是否认证
			this.$api.jsearchMsgs({
				id: this.list.id
			}).then(res => {
				if (res.code == 200) {
					this.whether = true,
						this.whethers = false
				}
			})
		}
	}
</script>

<style lang="scss" scoped>
	.j_solid {
		width: 100%;
		height: 2upx;
		background: darkgray;
	}

	.j_cont {
		width: 100%;
		height: 94vh;
		background: #F2F2F2;
	}

	//top_nav
	.j_top {
		width: 100%;
		height: 80upx;
		border-bottom: 2upx solid #f0f0f0;
		text-align: center;
		line-height: 80upx;
		font-size: 30upx;
		background: white;
		margin-bottom: 40upx;

	}

	//name 登录
	.j_login {
		width: 100%;
		height: 120upx;
		background: white;
		padding: 10upx 20upx 10upx 20upx;
		box-sizing: border-box;
		display: flex;
		margin-bottom: 40upx;

		//头像
		.j_lginimg {
			width: 100upx;
			height: 100%;
			background: darkgoldenrod;
			border-radius: 50%;
			overflow: hidden;

			img {
				width: 100%;
				height: 100%;
			}
		}

		//名字
		.j_loginname {
			width: 200upx;
			height: 100%;
			margin-left: 20upx;

			//name 昵称样式
			.j_name_top {
				width: 100%;
				height: 60upx;
				text-align: left;
				line-height: 60upx;
				font-size: 30upx;
			}

			//身份证认证
			.j_name_bom {
				width: 40upx;
				height: 40upx;
				margin-top: 10upx;

				img {
					width: 100%;
				}
			}
		}

		//积分钱包
		.j_login_right {
			width: 200upx;
			height: 100%;
			margin-left: 200upx;

			.j_integral {
				width: 100%;
				height: 40upx;
				text-align: center;
				line-height: 40upx;
			}

			.j_number {
				width: 100%;
				height: 80upx;
				text-align: center;
				line-height: 70upx;
				font-size: 40upx;
			}
		}
	}

	//收货地址
	.j_address {
		width: 100%;
		height: 80upx;
		background: white;
		padding: 10upx 20upx 10upx 20upx;
		box-sizing: border-box;
		position: relative;
		display: flex;


		//icon图标样式
		.j_icon {
			width: 80upx;
			height: 100%;
			text-align: center;
			line-height: 80upx;

			img {
				width: 40upx;
				height: 40upx;
			}
		}

		//标签内容
		.j_title {
			width: 400upx;
			height: 100%;
			line-height: 60upx;
			font-size: 30upx;
			text-indent: 20upx;
		}

		//开始
		.j_addright {
			width: 100%;
			height: 100%;
			display: flex;
			justify-content: flex-end;

			.j_addcont {
				width: 40upx;
				height: 100%;
				font-size: 40upx;
				text-align: center;
				line-height: 60upx;
			}
		}
	}

	.j_details {
		margin-top: 40upx;
	}
</style>
